package com.hdsx.jxcsxm.utile.http;

import org.apache.log4j.Logger;

import javax.net.ssl.SSLContext;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;

/**
 * 
* @ClassName: SSLContextBuilderImpl 
* @Description: TODO
* @author houyaoshan 
* @date 2015年7月30日 上午11:23:00
 */
public class SSLContextBuilder {
	private static Logger log = Logger.getLogger(SSLContextBuilder.class);
	public static SSLContext getSSLContext(){
		try {
			return  new org.apache.http.conn.ssl.SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy()).build();
		} catch (KeyManagementException e) {
			log.error(e.getMessage());
			return null;
		} catch (NoSuchAlgorithmException e) {
			log.error(e.getMessage());
			return null;
		} catch (KeyStoreException e) {
			log.error(e.getMessage());
			return null;
		}
	}
}
